<template>
  <div>
    <button v-on:click="go">sssss</button>
    <table class="table table-striped">
      <thead>
      <td class="code">工号</td>
      <td class="name">老师姓名</td>
      <td class="deptid">部门名称</td>
      <td class="sex">性别</td>
      <td class="idCard">身份证号码</td>
      <td class="tel">电话</td>
      <td class="email">邮箱</td>
      <td class="email"></td>
      </thead>
      <tbody>
      <tr v-for="item in teacherData.list">
        <td class="code">{{item.code}}</td>
        <td class="name v-middle">{{item.name}}</td>
        <td class="deptid v-middle">{{item.deptIdNameref}}</td>
        <td class="sex v-middle">{{item.sex}}</td>
        <td class="idCard v-middle">{{item.idCard}}</td>
        <td class="tel v-middle">{{item.tel}}</td>
        <td class="email v-middle">{{item.email}}</td>
        <td class="email v-middle">
          <router-link :to="{name:'teacher', params: { id: item.id }}">查看详情</router-link>
        </td>
      </tr>

      </tbody>
      </tobdy>

    </table>
  </div>
</template>

<script>
  const Foo = resolve => {
    // require.ensure 是 Webpack 的特殊语法，用来设置 code-split point
    // （代码分块）
    require.ensure(['../../Hello.vue'], () => {
      resolve(require('../../Hello.vue'))
    })
  }


  var exportData = {teacherData: {}};
  jQuery.ajax({
    url: "/school/edu/teacher/read/list",
    type: "post",
    async: false,
    success: function (data) {
      if (data) {
        exportData.teacherData = data.data;
      }
    },
    error: function (data) {
    }
  })
  export default {
    name: 'teacherList',
    data: function () {
      return exportData;
    },
    methods: {
        go:function(){
            this.$router.push("/login")
        }
    }
  }
</script>

<style scope>
</style>
